import request from '@/request';

export const fetchPay = function <T = any, U = any>(data: T): Promise<U> {
    return request({
        method: 'post',
        url: '/pay/pcpay',
        data,
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
    });
};

export const fetchOrderFefund = function <T = any, U = any>(data: T): Promise<U> {
    return request({
        method: 'get',
        url: '/pay/order_refund',
        params: data,
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
    });
};

export const fetchQueryOrderStatus = function <T = any, U = any>(data: T): Promise<U> {
    return request({
        method: 'get',
        url: '/pay/order_query',
        params: data,
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
    });
};
